#
# /*
#  *  This program is free software: you can redistribute it and/or modify
#  *  it under the terms of the GNU General Public License as published by
#  *  the Free Software Foundation, either version 3 of the License, or
#  *  (at your option) any later version.
#  *
#  *  This program is distributed in the hope that it will be useful,
#  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  *  GNU General Public License for more details.
#  *
#  *  You should have received a copy of the GNU General Public License
#  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
#  *
#  * SPDX-License-Identifier: GPL-3.0+
#  * License-Filename: LICENSE
#  *
#  */
#

#
bin_PROGRAMS = qhgcc

#
qhgcc_SOURCES = \
	main.c \
	mem.c \
	uniqstring.c \
	uniqnode.c \
	gml.c \
	splay-tree.c

#
qhgcc_H = \
	main.h \
	mem.h \
	uniqstring.h \
	uniqnode.h \
	gml.h \
	splay-tree.h

#
qhgcc_CFLAGS = \
	@CFLAGS@ @PACKAGE_CFLAGS@ @WARNING_CFLAGS@ @GTK_CFLAGS@

#
qhgcc_tolink = @GTK_LIBS@

#
qhgcc$(EXEEXT): $(qhgcc_SOURCES)
	rm -v -f ./*.o
	rm -v -f ./qhgcc
	$(CC) -c $(qhgcc_CFLAGS) $(qhgcc_SOURCES) -I. -I.. -I../..
	$(CXX) *.o $(qhgcc_tolink) -o qhgcc

#
indent:
	./lindent.sh $(qhgcc_SOURCES) $(qhgcc_H)

# peg parser
parser:
	rm -v -f ./packcc
	rm -v -f ./gml.c
	rm -v -f ./gml.h
	$(CC) -std=gnu89 -Wall -Wextra -Wno-unused-parameter -Wno-overlength-strings -pedantic -O2 -DNDEBUG packcc.c -o packcc
	./packcc gml.peg

#
clean:
	rm -v -f *.o
	rm -v -f qhgcc
	rm -v -f *~
	rm -v -f ./packcc

#
cleaner:
	make clean-generic

#
distclean:
	make clean-generic

#
clean-generic:
	rm -v -f *~
	rm -v -f ./*.o
	rm -v -f ./*.a
	rm -v -f ./*.i
	rm -v -f ./*.s
	rm -v -f ./O
	rm -v -f ./OO
	rm -v -f ./O1
	rm -v -f ./O2
	rm -v -f ./O3
	rm -v -f *.dot
	rm -v -f -r -d .deps
	rm -v -f -r -d .libs
	rm -v -f *.o
	rm -v -f Makefile
	rm -v -f Makefile.in
	rm -v -f qhgcc
	rm -v -f ./packcc

# /* end */
